Learn R Programming

ks (version 1.3.2)

Hkda, Hkda.diag: Bandwidth matrix selectors for kernel discriminant analysis for multivariate data

Description

Bandwidth matrices for kernel discriminant analysis for 2- to 6-dimensional data.

Usage

Hkda(x, x.group, Hstart, bw="plugin", nstage=2, pilot="samse",
     pre="sphere")
Hkda.diag(x, x.group, bw="plugin", nstage=2, pilot="samse", 
     pre="sphere")

Arguments

x
matrix of training data values
x.group
vector of group labels for training data
bw
bandwidth: "plugin" = plug-in, "lscv" = LSCV, "scv" = SCV
nstage
number of stages in the plug-in bandwidth selector (1 or 2)
pilot
"amse" = AMSE pilot bandwidths, "samse" = single SAMSE pilot bandwidth
pre
"scale" = pre-scaling, "sphere" = pre-sphering
Hstart
(stacked) matrix of initial bandwidth matrices, used in numerical optimisation

Value

  • Stacked matrix of bandwidth matrices for each training data group.

Details

The values that valid for bw are "plugin", "lscv" and "scv" for Hkda. These in turn call Hpi, Hlscv and Hscv. For plugin selectors, all of nstage, pilot and pre need to be set. For SCV selectors, currently nstage is always programmed to be one but the other two need to be set. For LSCV selectors, none of them are required.

For Hkda.diag, options are "plugin" or "lscv" which in turn call respectively Hpi.diag and Hlscv.diag. Again, nstage, pilot and pre are available for Hpi.diag but not required for Hlscv.diag.

References

Duong, T. (2004) Bandwidth Matrices for Multivariate Kernel Density Estimation. Ph.D. Thesis. University of Western Australia.

Simonoff, J. S. (1996) Smoothing Methods in Statistics. Springer-Verlag. New York.

See Also

kda.kde, Hpi, Hpi.diag, Hlscv, Hlscv.diag, Hscv

Examples

Run this code
library(MASS)
data(iris)
iris.mat <- rbind(iris[,,1], iris[,,2], iris[,,3])
ir <- iris.mat[,c(1,2)]
ir.gr <- iris.mat[,5]

Hkda(ir, ir.gr, bw="scv", pre="scale")
Hkda.diag(ir, ir.gr, bw="plugin", pre="scale")

Run the code above in your browser using DataLab